#version 330 core
// vim: set filetype=cpp :vim

layout(points) in;
layout(triangle_strip, max_vertices=6) out;

uniform mat4 mProj;
uniform float umpp;

void main(void) {
	vec3 cent=gl_in[0].gl_Position.xyz/gl_in[0].gl_Position.w;

	vec2 u=vec2(1, 0);
	vec2 v=vec2(-u.y, u.x);
	vec2 vpos=cent.xy+u*umpp+v*umpp;
	gl_Position=mProj*vec4(vpos, cent.z, 1.0);
	EmitVertex();
	vpos=cent.xy+u*umpp-v*umpp;
	gl_Position=mProj*vec4(vpos, cent.z, 1.0);
	EmitVertex();
	vpos=cent.xy-u*umpp+v*umpp;
	gl_Position=mProj*vec4(vpos, cent.z, 1.0);
	EmitVertex();
	vpos=cent.xy-u*umpp-v*umpp;
	gl_Position=mProj*vec4(vpos, cent.z, 1.0);
	EmitVertex();
}

